<template>
  <!--毕业设计（论文）-->
  <div class=" graduation-design-info">
    <DesignCard :title="$t('graduationDesign.studentInfo')" v-if="actionType !== 'ADD' && actionType !== 'EDIT'">
      <el-form :model="studentForm" ref="studentForm" label-position="right" label-suffix="：" label-width="100px">
        <el-row>
          <el-col :span="6">
            <el-form-item :label="$t('graduationDesign.studentId')">
              <span>{{studentForm.studentId}}</span>
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item :label="$t('graduationDesign.name')">
              <span>{{studentForm.studentName}}</span>
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item :label="$t('graduationDesign.college')">
              <span>{{studentForm.collegeI18n}}</span>
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item :label="$t('graduationDesign.major')">
              <span>{{studentForm.subjectName}}</span>
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item :label="$t('graduationDesign.direction')">
              <span>{{studentForm.directionName}}</span>
            </el-form-item>
          </el-col>
        </el-row>
      </el-form>
    </DesignCard>

    <DesignCard :title="$t('graduationDesign.graduationDesignInfo')" :showExpand="actionType !== 'ADD' && actionType !== 'EDIT'">
      <el-form :model="graduationDesignInfoForm" ref="graduationDesignInfoForm" :rules="graduationDesignRules" label-position="right" label-suffix="：" label-width="150px">
        <el-row>
          <el-col :span="12">
            <el-form-item :label="$t('graduationDesign.subjectName')">
              <el-input v-model="graduationDesignInfoForm.projectName" disabled></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item :label="$t('graduationDesign.subtitle')">
              <el-input v-model="graduationDesignInfoForm.subtitleName" disabled></el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col>
            <el-form-item :label="$t('graduationDesign.subjectIntroduction')">
              <el-input type="textarea" v-model="graduationDesignInfoForm.introductionProject" :rows="4" show-word-limit :placeholder="$t('graduationDesign.pleaseEnter')" maxlength="500" disabled></el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col>
            <el-form-item :label="$t('graduationDesign.reference')">
              <el-input type="textarea" v-model="graduationDesignInfoForm.reference" :rows="4" show-word-limit :placeholder="$t('graduationDesign.pleaseEnter')" maxlength="500" disabled></el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col>
            <el-form-item :label="$t('graduationDesign.originalThesis')" prop="dissertationPath">
              <el-upload v-if="actionType === 'ADD' || actionType === 'EDIT'" ref="upload" :data="{bucketname: 'face', folderpath: 'file'}" :file-list="fileList" :on-success="uploadSuccess" :multiple="false" :limit="1" accept=".doc, .docx, .pdf" :before-upload="beforeUpload" :action="importUrl" :on-error="handleError" :on-exceed="handleExceed" :on-progress="handleUpload" :on-change="handleUploadChange" :on-remove="handleDissertationRemove">
                <el-button slot="trigger" size="small" type="primary" icon="el-icon-upload" v-loading.fullscreen.lock="loading" element-loading-text="Loading" element-loading-spinner="el-icon-loading" element-loading-background="rgba(255, 255, 255, .48)">{{$t('graduationDesign.uploadFile')}}</el-button>
                <span slot="tip" class="el-upload__tip upload-tips">仅支持word，pdf 文档</span>
              </el-upload>
              <el-button type="text" @click="onDownload(graduationDesignInfoForm.dissertationPath)" v-else>{{graduationDesignInfoForm.dissertationName}}</el-button>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col>
            <el-form-item :label="$t('graduationDesign.attachment')">
              <el-upload v-if="actionType === 'ADD' || actionType === 'EDIT'" ref="attachmentUpload" :data="{bucketname: 'face', folderpath: 'file'}" :file-list="attachmentFileList" :on-success="attachmentUploadSuccess" :multiple="false" :on-change="(file, fileList)=>{ this.attachmentFileList = fileList}" :limit="1" accept=".zip, .rar, .7z" :before-upload="attachmentBeforeUpload" :on-progress="handleUpload" :action="importUrl" :on-error="handleError" :on-exceed="handleExceed" :on-remove="handleAttachRemove">
                <el-button slot="trigger" size="small" type="primary" icon="el-icon-upload">{{$t('graduationDesign.uploadFile')}}</el-button>
                <span slot="tip" class="el-upload__tip upload-tips">{{$t('graduationDesign.attachmentUploadTips')}}</span>
              </el-upload>
              <el-button type="text" @click="onDownload(graduationDesignInfoForm.attachPath)" v-else>{{graduationDesignInfoForm.attachName}}</el-button>
            </el-form-item>
          </el-col>
        </el-row>

        <div class="edu-opertion-bar bottom-line" v-if="actionType === 'ADD' || actionType === 'EDIT'">
          <div class="float-right bottom-btn">
            <el-button @click="onCancel">{{$t('graduationDesign.cancel')}}</el-button>
            <el-button type="primary" @click="onSave">{{$t('graduationDesign.save')}}</el-button>
            <el-button type="primary" @click="onSubmit">{{$t('graduationDesign.submit')}}</el-button>
          </div>
        </div>
      </el-form>
    </DesignCard>

    <DesignCard :title="$t('graduationDesign.review')" v-if="actionType === 'REVIEW' || actionType === 'REVIEW_VIEW'">
      <el-form :model="reviewForm" ref="reviewForm" :rules="reviewRules" label-position="right" label-suffix="：" label-width="100px">
        <p class="graduation-design-label">{{$t('graduationDesign.academicLevelBusinessAbilityEvaluation')}}</p>
        <el-form-item prop="professionComment ">
          <el-input type="textarea" v-model="reviewForm.professionComment " :rows="4" show-word-limit :placeholder="$t('graduationDesign.pleaseEnter')" maxlength="100000" :disabled="actionType === 'VIEW' || actionType === 'REVIEW_VIEW'"></el-input>
        </el-form-item>
        <p class="graduation-design-label">{{$t('graduationDesign.thesisEvaluation')}}</p>
        <el-form-item prop="attachComment">
          <el-input type="textarea" v-model="reviewForm.attachComment" :rows="4" show-word-limit :placeholder="$t('graduationDesign.pleaseEnter')" maxlength="100000" :disabled="actionType === 'VIEW' || actionType === 'REVIEW_VIEW'"></el-input>
        </el-form-item>
        <p class="graduation-design-label" v-if="actionType === 'REVIEW'">{{$t('graduationDesign.reviewRemark')}}</p>
        <el-form-item prop="content" v-if="actionType === 'REVIEW'">
          <el-input type="textarea" v-model="reviewForm.content" :rows="4" show-word-limit :placeholder="$t('graduationDesign.requiredWhenRejected')" maxlength="20000"></el-input>
        </el-form-item>
        <!--审核成绩（通过时必填）-->
        <p class="graduation-design-label" v-if="actionType === 'REVIEW'">{{$t('graduationDesign.reviewResult')}}</p>
        <el-form-item prop="result" v-if="actionType === 'REVIEW'">
          <el-select v-model="reviewForm.result" clearable class="graduation-design-select" filterable>
            <el-option v-for="item in source.resultTypeOptions" :key="item.value" :label="item.label" :value="item.value">
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item :label="$t('graduationDesign.thesisUpload')" label-width="175px" prop="dissertationPath">
          <el-upload v-if="actionType === 'REVIEW'" ref="reviewUpload" :data="{bucketname: 'face', folderpath: 'file'}" :file-list="fileList" :on-success="uploadReviewSuccess" :multiple="false" :on-progress="handleUpload" :on-change="handleUploadChange" :limit="1" accept=".doc, docx" :before-upload="beforeUpload2" :action="importUrl" :on-error="handleError" :on-remove="handleReviewRemove">
            <el-button slot="trigger" size="small" type="primary" icon="el-icon-upload">{{$t('graduationDesign.uploadFile')}}</el-button>
            <span slot="tip" class="el-upload__tip upload-tips">仅支持word，pdf 文档</span>
          </el-upload>
          <el-button type="text" @click="onDownload(graduationDesignInfoForm.dissertationPath)" v-else>{{graduationDesignInfoForm.dissertationName}}</el-button>
        </el-form-item>
        <el-form-item :label="$t('graduationDesign.attachment')" label-width="175px">
          <el-upload v-if="actionType === 'REVIEW'" ref="attachmentUpload" :data="{bucketname: 'face', folderpath: 'file'}" :file-list="attachmentFileList" :on-success="attachmentUploadSuccess" :multiple="false" :on-change="(file, fileList)=>{ this.attachmentFileList = fileList}" :limit="1" accept=".zip, .rar, .7z" :before-upload="attachmentBeforeUpload" :on-progress="handleUpload" :action="importUrl" :on-error="handleError" :on-exceed="handleExceed" :on-remove="handleAttachRemove">
            <el-button slot="trigger" size="small" type="primary" icon="el-icon-upload">{{$t('graduationDesign.uploadFile')}}</el-button>
            <span slot="tip" class="el-upload__tip upload-tips">{{$t('graduationDesign.attachmentUploadTips')}}</span>
          </el-upload>
          <el-button type="text" @click="onDownload(graduationDesignInfoForm.attachPath)" v-else>{{graduationDesignInfoForm.attachName}}</el-button>
        </el-form-item>
        <div class="edu-opertion-bar" v-if="actionType === 'REVIEW'">
          <div class="float-right bottom-btn">
            <el-button @click="onCancel">{{$t('graduationDesign.cancel')}}</el-button>
            <el-button type="danger" @click="onReject">{{$t('graduationDesign.reject')}}</el-button>
            <el-button type="primary" @click="onPass">{{$t('graduationDesign.pass')}}</el-button>
          </div>
        </div>
      </el-form>
    </DesignCard>

    <DesignCard :title="$t('graduationDesign.reviewProgress')" v-if="actionType === 'REVIEW_VIEW' || actionType === 'REVIEW'">
      <edu-table ref="reviewProgressTable" :data="progressData" :selection="false" :pagination="false">
        <edu-table-column :label="$t('graduationDesign.time')" prop="time" :formatter="formatDate" min-width="120"></edu-table-column>
        <edu-table-column :label="$t('graduationDesign.approvers')" min-width="100">
          <template slot-scope="scope">
            <span>{{scope.row.approvorName}}【{{scope.row.approvorId}}】</span>
          </template>
        </edu-table-column>
        <edu-table-column :label="$t('graduationDesign.role')" prop="role" min-width="90"></edu-table-column>
        <edu-table-column :label="$t('graduationDesign.approvalResult')" prop="result" min-width="90">
          <template slot-scope="scope">
            <el-tag v-if="scope.row.result === 'COMMIT'" type="success">{{$t('graduationDesign.submit')}}</el-tag>
            <el-tag v-if="scope.row.result === 'Process'" type="success">{{$t('graduationDesign.pass')}}</el-tag>
            <el-tag v-if="scope.row.result === 'End'" type="info">{{$t('graduationDesign.over')}}</el-tag>
            <el-tag v-if="scope.row.result === 'Reject'" type="warning">{{$t('graduationDesign.rejected')}}</el-tag>
          </template>
        </edu-table-column>
        <edu-table-column :label="$t('graduationDesign.approvalRemark')" prop="content" min-width="120"></edu-table-column>
      </edu-table>
    </DesignCard>
  </div>
</template>
<script>
import API from "common/src/api/underGraduationDesign/graduationDesign";
import filters from "common/src/filters";

export default {
  name: '',
  props: {
    studentForm: {
      type: Object,
      default: {}
    },
    graduationDesignForm: {
      type: Object,
      default: {}
    },
    progressData: {
      type: Array,
      default: []
    },
    actionType: {
      type: String,
      default: ""
    },
    dataInfo: {
      type: Object,
      default: {}
    },
  },
  data() {
    return {
      api: API,
      graduationDesignInfoForm: {},
      graduationDesignRules: {
        dissertationPath: [
          { required: true, message: this.$t('graduationDesign.pleaseUploadFile'), trigger: 'change' }
        ]
      },
      reviewForm: {
        professionComment: '',
        attachComment: '',
        content: '',
        result: '',
        dissertationPath: ''
      },
      reviewRules: {
        content: [
          { required: true, message: this.$t('graduationDesign.pleaseEnter'), trigger: 'blur' }
        ],
        result: [
          { required: true, message: this.$t('graduationDesign.pleaseChoose'), trigger: 'change' }
        ],
        dissertationPath: [
          { required: true, message: this.$t('graduationDesign.pleaseUploadFile'), trigger: 'change' }
        ]
      },
      source: {
        resultTypeOptions: [{
          label: '优',
          value: 0
        }, {
          label: '良',
          value: 1
        }, {
          label: '中',
          value: 2
        }, {
          label: '及格',
          value: 3
        }, {
          label: '不及格',
          value: 4
        }]
      },
      loading: false,
      importUrl: '/api/commonservice/obsfile/uploadfile',
      fileList: [], // 新增 编辑 审核时上传的文件
      attachmentFileList: [], // 附件
      fileName: "",
      // 待删除的论文原件和附件的路径（删除状态）
      dissertationDeletedFilePath: '',
      dissertationDeleteStatus: false,
      attachDeletedFilePath: '',
      attachDeleteStatus: false
    };
  },
  created() {
    this.graduationDesignInfoForm = JSON.parse(JSON.stringify(this.graduationDesignForm));
  },
  mounted() {
    if (this.actionType === "EDIT") {
      // 存原文件路径初始值
      this.dissertationDeletedFilePath = this.graduationDesignInfoForm.dissertationPath;
      this.attachDeletedFilePath = this.graduationDesignInfoForm.attachPath;
      this.dissertationDeleteStatus = false;
      this.attachDeleteStatus = false;
      if (this.graduationDesignInfoForm.dissertationPath) {
        this.fileList = [{
          name: this.graduationDesignInfoForm.dissertationName,
          url: this.graduationDesignInfoForm.dissertationPath
        }];
      }
      if (this.graduationDesignInfoForm.attachPath) {
        this.attachmentFileList = [{
          name: this.graduationDesignInfoForm.attachName,
          url: this.graduationDesignInfoForm.attachPath
        }];
      }
    }
    if (this.actionType === "VIEW" || this.actionType === 'REVIEW_VIEW') {
      this.reviewForm.professionComment = this.graduationDesignInfoForm.professionComment;
      this.reviewForm.attachComment = this.graduationDesignInfoForm.attachComment;
    }
  },
  methods: {
    formatDate(row, column, cellValue, index) {
      return filters.formatDate(cellValue, "yyyy/MM/dd hh:mm:ss");
    },
    deleteFileFromObs(path) {
      return this.api.deleteFile(path).then(res => {
        return res;
      });
    },
    // 保存
    onSave() {
      this.$refs.graduationDesignInfoForm.validate(async (valid) => {
        if (valid) {
          // 上传的原文件被修改，则提交的时候删除obs库中的原文件，只保留一个最新的文件
          if (this.actionType === "EDIT" && this.dissertationDeleteStatus) {
            await this.deleteFileFromObs(this.dissertationDeletedFilePath);
          } else if (this.actionType === "EDIT" && this.attachDeleteStatus) {
            await this.deleteFileFromObs(this.attachDeletedFilePath);
          }
          this.$emit("graduation-design-save", this.graduationDesignInfoForm, this.actionType);
        } else {
          return false;
        }
      });
    },
    // 提交
    onSubmit() {
      this.$refs.graduationDesignInfoForm.validate(async (valid) => {
        if (valid) {
          if (this.actionType === "EDIT" && this.dissertationDeleteStatus) {
            await this.deleteFileFromObs(this.dissertationDeletedFilePath);
          } else if (this.actionType === "EDIT" && this.attachDeleteStatus) {
            await this.deleteFileFromObs(this.attachDeletedFilePath);
          }
          this.$emit("graduation-design-submit", this.graduationDesignInfoForm);
        } else {
          return false;
        }
      });
    },
    // 通过
    onPass() {
      if(this.dataInfo&&this.dataInfo.no){
        this.graduationDesignInfoForm.flowNo=this.dataInfo.no;
      }
      if (this.reviewForm.dissertationPath) {
        this.graduationDesignInfoForm.dissertationName = this.reviewForm.dissertationName;
        this.graduationDesignInfoForm.dissertationPath = this.reviewForm.dissertationPath;
      }
      this.graduationDesignInfoForm.professionComment = this.reviewForm.professionComment;
      this.graduationDesignInfoForm.attachComment = this.reviewForm.attachComment;
      this.graduationDesignInfoForm.result = this.reviewForm.result;
      const params = {
        graduationDesignInfoForm: this.graduationDesignInfoForm,
        idList: [this.graduationDesignInfoForm.flowNo],
        desc: this.reviewForm.content,
        status: "End"
      };
      // 驳回时，审核意见，上传文件非必填，审核成绩必填
      this.reviewRules.content = [];
      this.reviewRules.dissertationPath = [];
      this.$refs.reviewForm.clearValidate();
      this.reviewRules.result = [{ required: true, message: this.$t('graduationDesign.pleaseChoose'), trigger: 'change' }];
      this.$refs.reviewForm.validate(valid => {
        if (valid) {
          this.$emit("graduation-design-pass", params, "End");
        } else {
          return false;
        }
      });
    },
    // 驳回
    onReject() {
      if(this.dataInfo&&this.dataInfo.no){
        this.graduationDesignInfoForm.flowNo=this.dataInfo.no;
      }
      if (this.reviewForm.dissertationPath) {
        this.graduationDesignInfoForm.dissertationName = this.reviewForm.dissertationName;
        this.graduationDesignInfoForm.dissertationPath = this.reviewForm.dissertationPath;
      }
      this.graduationDesignInfoForm.professionComment = this.reviewForm.professionComment;
      this.graduationDesignInfoForm.attachComment = this.reviewForm.attachComment;
      this.graduationDesignInfoForm.result = this.reviewForm.result;
      const params = {
        graduationDesignInfoForm: this.graduationDesignInfoForm,
        idList: [this.graduationDesignInfoForm.flowNo],
        desc: this.reviewForm.content,
        status: "Reject"
      };
      // 驳回时，审核意见，上传文件必填，审核成绩非必填
      this.reviewRules.content = [{ required: true, message: this.$t('graduationDesign.pleaseEnter'), trigger: 'blur' }];
      this.reviewRules.dissertationPath = [{ required: true, message: this.$t('graduationDesign.pleaseChoose'), trigger: 'change' }];
      this.reviewRules.result = [];
      this.$refs.reviewForm.clearValidate("result");
      this.$refs.reviewForm.validate(valid => {
        if (valid) {
          this.$emit("graduation-design-reject", params, "Reject");
        } else {
          return false;
        }
      });
    },
    // 取消
    onCancel() {
      this.$emit("graduation-design-cancel");
    },
    // 文件下载
    onDownload(path) {
      window.location.href = "/api/commonservice/obsfile/downloadfile?objectkey=" + path;
    },
    handleExceed(files, fileList) {
      this.$message.warning(this.$t('graduationDesign.onlyOneFileCanBeUpload'));
    },
    // 清除文件
    clearFiles(upload, fileList) {
      this.$refs[upload].clearFiles();
      this[fileList] = [];
    },
    //论文上传校验
    beforeUpload(file) {
      const fileType = file.name.replace(/.+\./, "");
      const isSize = file.size / (1024 * 1024 * 50) < 1;
      const isFile = ['doc', 'docx', 'pdf'].includes(fileType.toLowerCase());
      if (!isFile) {
        this.$message.error('仅支持word，pdf 文档');
        this.clearFiles("upload", "fileList");
      }
      if (!isSize) {
        this.$message.error(this.$t('graduationDesign.dissertationUploadFileSizeMsg'));
        this.clearFiles("upload", "fileList");
      }
      if (!(isSize && isFile)) {
        this.loading = false;
      }
      return isSize && isFile;
    },
    beforeUpload2(file) {
      const fileType = file.name.replace(/.+\./, "");
      const isSize = file.size / (1024 * 1024 * 50) < 1;
      const isFile = ['doc', 'docx', 'pdf'].includes(fileType.toLowerCase());
      if (!isFile) {
        this.$message.error('仅支持word，pdf 文档');
        this.clearFiles("reviewUpload", "fileList");
      }
      if (!isSize) {
        this.$message.error(this.$t('graduationDesign.dissertationUploadFileSizeMsg'));
        this.clearFiles("upload", "fileList");
      }
      if (!(isSize && isFile)) {
        this.loading = false;
      }
      return isSize && isFile;
    },
    //附件上传校验
    attachmentBeforeUpload(file) {
      const fileType = file.name.replace(/.+\./, "");
      const isSize = file.size / (1024 * 1024 * 50) < 1;
      const isFile = ['rar', 'zip', '7z', 'gz', 'tar', 'bz2', 'jar', 'cab', 'arj', 'lzh', 'ace', 'uue', 'iso', 'mpq'].includes(fileType.toLowerCase());
      if (!isFile) {
        this.$message.error(this.$t('graduationDesign.attachmentUploadFileTypeMsg'));
        this.clearFiles("attachmentUpload", "attachmentFileList");
      }
      if (!isSize) {
        this.$message.error(this.$t('graduationDesign.attachmentUploadFileSizeMsg'));
        this.clearFiles("attachmentUpload", "attachmentFileList");
      }
      if (!(isSize && isFile)) {
        this.loading = false;
      }
      return isSize && isFile;
    },
    handleUploadChange(file, fileList) {
      this.fileList = fileList;
    },
    handleUpload(event, file, fileList) {
      this.loading = true;
    },
    // 论文上传成功
    uploadSuccess(res, file, fileList) {
      this.loading = false;
      if (res.code == 200) {
        this.graduationDesignInfoForm.dissertationName = res.data[file.name].fileName;
        this.graduationDesignInfoForm.dissertationPath = res.data[file.name].objectkey;
        this.$message.success(this.$t('graduationDesign.uploadSuccess'));
        this.$refs.graduationDesignInfoForm.clearValidate();
      }
    },
    // 附件上传成功
    attachmentUploadSuccess(res, file, fileList) {
      this.loading = false;
      if (res.code == 200) {
        this.graduationDesignInfoForm.attachName = res.data[file.name].fileName;
        this.graduationDesignInfoForm.attachPath = res.data[file.name].objectkey;
        this.$message.success(this.$t('graduationDesign.uploadSuccess'));
      }
    },
    // 审核论文原件上传成功
    uploadReviewSuccess(res, file, fileList) {
      this.loading = false;
      if (res.code == 200) {
        this.reviewForm.dissertationName = res.data[file.name].fileName;
        this.reviewForm.dissertationPath = res.data[file.name].objectkey;
        this.$message.success(this.$t('graduationDesign.uploadSuccess'));
        this.$refs.reviewForm.clearValidate();
      }
    },
    // 论文原件
    async handleDissertationRemove(file, fileList) {
      if (this.graduationDesignInfoForm.dissertationPath) {
        // 编辑时第一次修改了原文件，则删除状态标记为true
        if (this.actionType === "EDIT" && this.dissertationDeletedFilePath === this.graduationDesignInfoForm.dissertationPath) {
          this.dissertationDeleteStatus = true;
        } else {
          await this.deleteFileFromObs(this.graduationDesignInfoForm.dissertationPath);
        }
        this.$message.success(this.$t('graduationDesign.deleteSuccess'));
        this.graduationDesignInfoForm.dissertationName = "";
        this.graduationDesignInfoForm.dissertationPath = "";
        this.$refs.graduationDesignInfoForm.clearValidate();
      }
    },
    // 附件
    async handleAttachRemove(file, fileList) {
      if (this.graduationDesignInfoForm.attachPath) {
        // 编辑时第一次修改了原文件，则删除状态标记为true
        if (this.actionType === "EDIT" && this.attachDeletedFilePath === this.graduationDesignInfoForm.attachPath) {
          this.attachDeleteStatus = true;
        } else {
          await this.deleteFileFromObs(this.graduationDesignInfoForm.attachPath);
        }
        this.$message.success(this.$t('graduationDesign.deleteSuccess'));
        this.graduationDesignInfoForm.attachName = "";
        this.graduationDesignInfoForm.attachPath = "";
        this.$refs.graduationDesignInfoForm.clearValidate();
      }
    },
    // 审核论文原件
    async handleReviewRemove(file, fileList) {
      if (this.reviewForm.dissertationPath) {
        await this.deleteFileFromObs(this.reviewForm.dissertationPath);
        this.$message.success(this.$t('graduationDesign.deleteSuccess'));
        this.reviewForm.dissertationName = "";
        this.reviewForm.dissertationPath = "";
        this.$refs.reviewForm.clearValidate();
      }
    },
    handleError(err, file, fileList) {
      this.loading = false;
      this.$message.error(err.message);
    }
  }
}
</script>
<style lang="scss" scoped>
.graduation-design-info {
    .upload-tips {
        margin-left: 15px;
    }
    .graduation-design-label {
        font-weight: bold;
        color: #606266;
        margin-left: 100px;
    }
    .bottom-line {
        border-top: 1px solid #dcdfe6;
        .bottom-btn {
            margin-top: 20px;
        }
    }
    .prompt-bottom {
        margin-top: 0px;
        margin-bottom: 15px;
    }
    .graduation-design-select {
        width: 250px;
    }
}
</style>
